<!--
    page description : 근태관리 - 관리자 - 부서관리 화면
    author      : ych
    date        : 2009-01-08
    file name   : dept_mgr.jsp
-->
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 1.0 Transitional//EN" "http://www.w3.org/TR/htmL1/DTD/xhtml1-transitional.dtd">
<%@ taglib prefix="s" uri="/struts-tags" %> 
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>

<html>
<head>
    <s:head theme="ajax" />
    <script type="text/javascript" src="inc/js/aa.js"></script>
    <script type="text/javascript" src="inc/js/common.js"></script>
    
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="0" />
    
    <title>부서관리</title>
<!-- --------------------J A V A S C R I P T START-------------------- -->
<script type="text/javascript"><!--

    /**
        사업부 등록 팝업
    */
    function fnc_reg_upper_dept() {

		var w = 350;
		var h = 230;
	   
	   	var x = fnc_center_x(w);
	   	var y = fnc_center_y(h);
	   	
        var url     =   "dept_group_p.action";                  //popup page
        var nm      =   "deptmgr_reg_popup";                    //popup window name
        var attr    =   "width=" + w + " , height=" + h + " , top=" + y + " , left=" + x + " , status=no";       //window size
        
        //alert(param); //debug
        
        window.open(url , nm , attr);   //팝업창 열기
    }
    
    /*
        팀 등록 
    */
    function fnc_reg_lower_dept() {
        
		var w = 350;
    	var h = 230;
       
       	var x = fnc_center_x(w);
       	var y = fnc_center_y(h);
       	
        var url     =   "dept_team_pp.action";                       //popup page
        var nm      =   "deptmgr_reg_popup";                        //popup window name
        var attr    =   "width=" + w + " , height=" + h + " , top=" + y + " , left=" + x + " , status=no";       //window size
        
        //alert(param); //debug
        
        window.open(url , nm , attr); //팝업창 열기
    }
    
    /**
     *  사업그룹 수정
     *  팝업창으로 띄움.
     *  fnc_reg_mod_group_dept(int , string , string)
    */
    function fnc_reg_mod_group_dept(int_grp_no , int_team_no) {

        //그룹코드와 팀코드가 다를 경우 pop-up 안뜨게 함.
        if (int_grp_no != int_team_no) {
            return;
        }

        var w = 350;
       	var h = 230;
       
       	var x = fnc_center_x(w);
       	var y = fnc_center_y(h);
    
        var url     =   "dept_group_p.action";                      //popup page
        var nm      =   "deptmgr_mod_popup";                        //popup window name
        var attr    =   "width=" + w + " , height=" + h + " , top=" + y + " , left=" + x + " , status=no";       //window size
        
        var param = url   + "?" + "upper_dept_no="    + int_grp_no    //그룹코드
                          + "&" + "gubun=m"                           //등록/수정 구분자
        
        //alert(param); //debug
        
        window.open(param , nm , attr); //팝업창 열기
    }
    
    /**
     * 팀(부서) 수정 팝업
     * 팝업창으로 띄움.
     * fnc_mod_team_dept(int , int)
     */
    function fnc_mod_team_dept(int_grp_no , int_team_no) {
       
       //그룹코드일 경우 안 나오게 하기 위함.
       if (int_grp_no == int_team_no ) {
           return;
       }

       	var w = 350;
       	var h = 230;
       
       	var x = fnc_center_x(w);
       	var y = fnc_center_y(h);
       	
        var url     =   "dept_team_pp.action";                													//popup page
        var nm      =   "deptmgr_mod_popup";                        											//popup window name
        var attr    =   "width=" + w + " , height=" + h + " , top=" + y + " ,left=" + x + " , status=no";       //window size
        
        var param = url + "?"   + "upper_dept_no="  + int_grp_no    
                          + "&" + "dept_no="        + int_team_no
                          + "&" + "gubun=m";                         //등록/수정 구분자
        
        //alert(param); //debug
        
        window.open(param , nm , attr); //팝업창 열기

    }

    //ajax로 조회리스트 호출.
    function call_dojo() {
        dojo.event.topic.publish("ajax_list");
    }

  //popup 정가운데 띄우기
	function fnc_center_x(w) {

       	var x;
       	
		x =  (screen.availWidth - w) / 2;

       	return x;
	}

  	//popup 정가운데 띄우기
	function fnc_center_y(h) {

       	var y;
       	
		y =  (screen.availHeight - h) / 2;

       	return y;
	}
    
//--></script>
<!-- --------------------J A V A S C R I P T END-------------------- -->
</head>

<body>

<div class="fl_ri">
    <div id="contants_box">
    <div id="tit">  
		<span class="fl_ri tit_navi">Home &gt; 관리자 &gt; <span class="f_b">부서관리</span><img src="/images/btl_navi.gif" class="img_tp"></span>
		<div class="fl_le"><img src="/images/tit_menu05_img02.gif"></div>
	</div>
        <s:form name="frm" id="frm" theme="simple" method="post">
	        <s:hidden id="cur_page" name="cur_page"/>
			<!---------- TopLogo & Menu : STR ---------->
            <!----------Search_Box : STR ---------->
			<!----------Tbl_info & Table box ------>
			<div id="tbl_info_box02">
				<ul>
					<li>
		                <span class="tbl_info_box02" >
		                    <img src="/images/btn_bizadd.gif" class="img_tm" alt="사업부 등록"  onmousemove="this.style.cursor='pointer'"	onclick="fnc_reg_upper_dept()" />
		                    <img src="/images/btn_biz_add.gif" class="img_tm" alt="부서 등록"	onmousemove="this.style.cursor='pointer'"	onclick="fnc_reg_lower_dept()" />
		                </span>
                	</li>
                </ul>
            </div>

	        <s:url id="ajax_list"  action="dept_mgr_list"/>
	        <s:div id="itemAmtlistDiv" theme="ajax" executeScripts="true" showLoadingText="false" href="%{ajax_list}" listenTopics="ajax_list" formId="frm" />
        </s:form>
    </div>
</div>
</body>
</html>